package com.google.android.gms.internal;

import java.io.IOException;

public final class zzjh extends zzflm<zzjh> {
    private Integer zzbdq = null;
    private zzju zzbdr = null;
    private zzju zzbds = null;
    private zzju zzbdt = null;
    private zzju[] zzbdu = zzju.zzhx();
    private Integer zzbdv = null;

    public zzjh() {
        this.zzpvl = null;
        this.zzpnr = -1;
    }

    public final /* synthetic */ zzfls zza(zzflj zzflj) throws IOException {
        zzju zzju;
        while (true) {
            int zzcxx = zzflj.zzcxx();
            if (zzcxx == 0) {
                return this;
            }
            if (zzcxx != 8) {
                if (zzcxx == 18) {
                    if (this.zzbdr == null) {
                        this.zzbdr = new zzju();
                    }
                    zzju = this.zzbdr;
                } else if (zzcxx == 26) {
                    if (this.zzbds == null) {
                        this.zzbds = new zzju();
                    }
                    zzju = this.zzbds;
                } else if (zzcxx == 34) {
                    if (this.zzbdt == null) {
                        this.zzbdt = new zzju();
                    }
                    zzju = this.zzbdt;
                } else if (zzcxx == 42) {
                    int zzb = zzflv.zzb(zzflj, 42);
                    int length = this.zzbdu == null ? 0 : this.zzbdu.length;
                    zzju[] zzjuArr = new zzju[(zzb + length)];
                    if (length != 0) {
                        System.arraycopy(this.zzbdu, 0, zzjuArr, 0, length);
                    }
                    while (length < zzjuArr.length - 1) {
                        zzjuArr[length] = new zzju();
                        zzflj.zza(zzjuArr[length]);
                        zzflj.zzcxx();
                        length++;
                    }
                    zzjuArr[length] = new zzju();
                    zzflj.zza(zzjuArr[length]);
                    this.zzbdu = zzjuArr;
                } else if (zzcxx == 48) {
                    this.zzbdv = Integer.valueOf(zzflj.zzcym());
                } else if (!super.zza(zzflj, zzcxx)) {
                    return this;
                }
                zzflj.zza(zzju);
            } else {
                this.zzbdq = Integer.valueOf(zzflj.zzcym());
            }
        }
    }

    public final void zza(zzflk zzflk) throws IOException {
        if (this.zzbdq != null) {
            zzflk.zzad(1, this.zzbdq.intValue());
        }
        if (this.zzbdr != null) {
            zzflk.zza(2, (zzfls) this.zzbdr);
        }
        if (this.zzbds != null) {
            zzflk.zza(3, (zzfls) this.zzbds);
        }
        if (this.zzbdt != null) {
            zzflk.zza(4, (zzfls) this.zzbdt);
        }
        if (this.zzbdu != null && this.zzbdu.length > 0) {
            for (zzju zzju : this.zzbdu) {
                if (zzju != null) {
                    zzflk.zza(5, (zzfls) zzju);
                }
            }
        }
        if (this.zzbdv != null) {
            zzflk.zzad(6, this.zzbdv.intValue());
        }
        super.zza(zzflk);
    }

    /* access modifiers changed from: protected */
    public final int zzq() {
        int zzq = super.zzq();
        if (this.zzbdq != null) {
            zzq += zzflk.zzag(1, this.zzbdq.intValue());
        }
        if (this.zzbdr != null) {
            zzq += zzflk.zzb(2, (zzfls) this.zzbdr);
        }
        if (this.zzbds != null) {
            zzq += zzflk.zzb(3, (zzfls) this.zzbds);
        }
        if (this.zzbdt != null) {
            zzq += zzflk.zzb(4, (zzfls) this.zzbdt);
        }
        if (this.zzbdu != null && this.zzbdu.length > 0) {
            for (zzju zzju : this.zzbdu) {
                if (zzju != null) {
                    zzq += zzflk.zzb(5, (zzfls) zzju);
                }
            }
        }
        return this.zzbdv != null ? zzq + zzflk.zzag(6, this.zzbdv.intValue()) : zzq;
    }
}
